package cn.iocoder.yudao.module.written.exam.dal.mysql.jobcategories;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.written.exam.controller.admin.jobcategories.vo.JobCategoriesPageReqVO;
import cn.iocoder.yudao.module.written.exam.dal.dataobject.jobcategories.JobCategoriesDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 职位分类 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface JobCategoriesMapper extends BaseMapperX<JobCategoriesDO> {

    default PageResult<JobCategoriesDO> selectPage(JobCategoriesPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<JobCategoriesDO>()
                .betweenIfPresent(JobCategoriesDO::getCreateTime, reqVO.getCreateTime())
                .likeIfPresent(JobCategoriesDO::getCategoryName, reqVO.getCategoryName())
                .eqIfPresent(JobCategoriesDO::getCategoryLevel, reqVO.getCategoryLevel())
                .eqIfPresent(JobCategoriesDO::getParentCategoryId, reqVO.getParentCategoryId())
                .eqIfPresent(JobCategoriesDO::getParentCategoryIds, reqVO.getParentCategoryIds())
                .eqIfPresent(JobCategoriesDO::getEnableStatus, reqVO.getEnableStatus())
                .orderByDesc(JobCategoriesDO::getId));
    }

}